-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add core nft view #103
Add core nft view #103
Conversation
/// NFTView is a group of views used to give a complete picture of an NFT | ||
/// | ||
pub struct NFTView { | ||
pub let id: UInt64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we might also want uuid in here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you put a short test in here for this?
Done |
import ExampleNFT from "../../contracts/ExampleNFT.cdc" | ||
import MetadataViews from "../../contracts/MetadataViews.cdc" | ||
|
||
pub struct NFTView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is is necessary to define a new NFTView in here? Can't we just return the one from the view?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't return some of the views, specifically CollectionData which contains a function type. Cadence throws an error if you try to return a function type from a script(i believe there is an issue to fix this but in the current state it would throw an error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, that makes sense
See Issue: #98
Implementing the core NFT View which consists of common views that NFTs should implement to have basic interoperability throughout the ecosystem.